#pragma once

#include <opencv\cv.h>

#include <boost\signal.hpp>

#include "Marker.h"
#include "ImageProcessor.h"

namespace TUMAR { namespace MarkerTracking {
	class MarkerTracker
	{
	private:
		MemoryStorage memory;
		MarkerContainer markerContainer;

		cv::Mat buffer;

		GreyscaleImageProcessor greyProcessor;
		AdaptiveThresholdImageProcessor thresholdProcessor;
		MarkerDetectionImageProcessor markerProcessor;

		ImageProcessorChain processors;

	public:
		MarkerTracker(void);
		~MarkerTracker(void);

		boost::signal<void (const MarkerContainer& markers)> MarkersFound;

		void OnImageCaptured(const cv::Mat& image);
	};
}}
